Class NotificationParams


  • public class NotificationParams
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      NotificationParams​(android.os.Bundle bundle)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      android.os.Bundle bundleWithNotificationParametersRemoved()  
      boolean getBoolean​(java.lang.String key)
      Parses boolean value of corresponding key
      java.lang.Integer getInteger​(java.lang.String key)
      Parses the integer value of corresponding key
      org.json.JSONArray getJSONArray​(java.lang.String key)  
      java.lang.String[] getLocalizationArgs​(java.lang.String field)
      Method to fetch Localization Arguments for title and body
      java.lang.Object[] getLocalizationArgsForKey​(java.lang.String key)
      Returns loc_arg used for localization of title and body
      java.lang.String getLocalizationResourceForKey​(java.lang.String key)  
      java.lang.String getLocalizedString​(android.content.res.Resources resources, java.lang.String packageName, java.lang.String key)
      Tries to get localized String from the app resources, if not present returns null
      java.lang.Long getLong​(java.lang.String key)
      parses the long value for corresponding key
      java.lang.Integer getNotificationCount()  
      java.lang.Integer getNotificationPriority()  
      java.lang.String getPossibleLocalizedString​(android.content.res.Resources resources, java.lang.String packageName, java.lang.String key)
      Checks if original string(unlocalized) present then returns it, otherwise tries to get localized string for corresponding key
      java.lang.String getString​(java.lang.String key)
      Parses the value for the given key in the bundle
      java.lang.Integer getVisibility()  
      static boolean isNotification​(android.os.Bundle bundle)
      Checks if the current bundle contains keys related to Notification
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • NotificationParams

        public NotificationParams​(android.os.Bundle bundle)
    • Method Detail

      • isNotification

        public static boolean isNotification​(android.os.Bundle bundle)
        Checks if the current bundle contains keys related to Notification
        Parameters:
        bundle -
        Returns:
      • getString

        public java.lang.String getString​(java.lang.String key)
        Parses the value for the given key in the bundle
        Parameters:
        key -
        Returns:
      • getPossibleLocalizedString

        public java.lang.String getPossibleLocalizedString​(android.content.res.Resources resources,
                                                           java.lang.String packageName,
                                                           java.lang.String key)
        Checks if original string(unlocalized) present then returns it, otherwise tries to get localized string for corresponding key
        Parameters:
        resources -
        packageName -
        key -
        Returns:
        String
      • getLocalizedString

        public java.lang.String getLocalizedString​(android.content.res.Resources resources,
                                                   java.lang.String packageName,
                                                   java.lang.String key)
        Tries to get localized String from the app resources, if not present returns null
        Parameters:
        resources -
        packageName -
        key -
        Returns:
        localizedString
      • getLocalizationResourceForKey

        public java.lang.String getLocalizationResourceForKey​(java.lang.String key)
      • getLocalizationArgsForKey

        public java.lang.Object[] getLocalizationArgsForKey​(java.lang.String key)
        Returns loc_arg used for localization of title and body
        Parameters:
        key -
        Returns:
        array of String
      • getJSONArray

        public org.json.JSONArray getJSONArray​(java.lang.String key)
        Parameters:
        key -
        Returns:
        JSONArray for corresponding key
      • bundleWithNotificationParametersRemoved

        public android.os.Bundle bundleWithNotificationParametersRemoved()
        Returns:
        bundle with all the notification keys removed.
      • getLong

        public java.lang.Long getLong​(java.lang.String key)
        parses the long value for corresponding key
        Parameters:
        key -
        Returns:
        a long
      • getBoolean

        public boolean getBoolean​(java.lang.String key)
        Parses boolean value of corresponding key
        Parameters:
        key -
        Returns:
        boolean
      • getNotificationPriority

        public java.lang.Integer getNotificationPriority()
      • getInteger

        public java.lang.Integer getInteger​(java.lang.String key)
        Parses the integer value of corresponding key
        Parameters:
        key -
        Returns:
        integer
      • getVisibility

        public java.lang.Integer getVisibility()
      • getNotificationCount

        public java.lang.Integer getNotificationCount()
      • getLocalizationArgs

        public java.lang.String[] getLocalizationArgs​(java.lang.String field)
        Method to fetch Localization Arguments for title and body
        Parameters:
        field -
        Returns: